package com.grupit.engine.service.impl.mybatis.dao.generated;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

import com.grupit.engine.service.impl.mybatis.model.generated.NoteVO;
import com.grupit.engine.service.impl.mybatis.model.generated.NoteVOExample;

public interface NoteVOMapper {

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table NOTE
	 * @mbggenerated
	 */
	int countByExample(NoteVOExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table NOTE
	 * @mbggenerated
	 */
	int deleteByExample(NoteVOExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table NOTE
	 * @mbggenerated
	 */
	@Delete({ "delete from NOTE", "where NOTE_ID = #{noteId,jdbcType=BIGINT}" })
	int deleteByPrimaryKey(Long noteId);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table NOTE
	 * @mbggenerated
	 */
	@Insert({ "insert into NOTE (TARGET_SYSTEM_ID, LAST_MODIFIED, ", "OWNER_USER_ID, NOTE_TEXT, ", "X, Y)",
			"values (#{targetSystemId,jdbcType=VARCHAR}, #{lastModified,jdbcType=TIMESTAMP}, ",
			"#{ownerUserId,jdbcType=BIGINT}, #{noteText,jdbcType=VARCHAR}, ",
			"#{x,jdbcType=INTEGER}, #{y,jdbcType=INTEGER})" })
	@SelectKey(statement = "select @@IDENTITY as value", keyProperty = "noteId", before = false, resultType = Long.class)
	int insert(NoteVO record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table NOTE
	 * @mbggenerated
	 */
	int insertSelective(NoteVO record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table NOTE
	 * @mbggenerated
	 */
	List<NoteVO> selectByExample(NoteVOExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table NOTE
	 * @mbggenerated
	 */
	@Select({ "select", "NOTE_ID, TARGET_SYSTEM_ID, LAST_MODIFIED, OWNER_USER_ID, NOTE_TEXT, X, Y", "from NOTE",
			"where NOTE_ID = #{noteId,jdbcType=BIGINT}" })
	@ResultMap("BaseResultMap")
	NoteVO selectByPrimaryKey(Long noteId);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table NOTE
	 * @mbggenerated
	 */
	int updateByExampleSelective(@Param("record") NoteVO record, @Param("example") NoteVOExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table NOTE
	 * @mbggenerated
	 */
	int updateByExample(@Param("record") NoteVO record, @Param("example") NoteVOExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table NOTE
	 * @mbggenerated
	 */
	int updateByPrimaryKeySelective(NoteVO record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table NOTE
	 * @mbggenerated
	 */
	@Update({ "update NOTE", "set TARGET_SYSTEM_ID = #{targetSystemId,jdbcType=VARCHAR},",
			"LAST_MODIFIED = #{lastModified,jdbcType=TIMESTAMP},", "OWNER_USER_ID = #{ownerUserId,jdbcType=BIGINT},",
			"NOTE_TEXT = #{noteText,jdbcType=VARCHAR},", "X = #{x,jdbcType=INTEGER},", "Y = #{y,jdbcType=INTEGER}",
			"where NOTE_ID = #{noteId,jdbcType=BIGINT}" })
	int updateByPrimaryKey(NoteVO record);
}